<div class="modal-header">
    <h3 class="modal-title" ng-if="vote.id">修改投票</h3>
    <h3 class="modal-title" ng-if="!vote.id">添加投票</h3>
</div>
<div class="modal-body clearfix">
    <form class="form-horizontal">
        <div class="form-group">
            <label for="voteTitle" class="col-sm-2 control-label">投票标题</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="voteTitle" placeholder="请输入投票标题" ng-model="vote.title">
            </div>
        </div>
        <div class="form-group">
            <label for="voteDescription" class="col-sm-2 control-label">投票详情</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="voteDescription" placeholder="请输入投票标题"
                       ng-model="vote.description">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">投票问题</label>
            <div class="col-sm-10">
                <button type="button" class="btn btn-success btn-sm" title="点击添加问题" ng-click="addQuestion()">添加问题
                </button>
            </div>
        </div>
    </form>
    <div class="panel panel-info" ng-repeat="que in vote.questions track by $index">
        <div class="panel-heading">
            <div class="form-inline">
                <label class="control-label" ng-bind="'问题'+($index+1)"></label>
                <input type="text" class="form-control" placeholder="在这里输入问题" ng-model="que.title">
                <button type="button" class="btn btn-success btn-sm" title="点击添加选项" ng-click="addOption(que)">添加选项
                </button>
                <button type="button" class="btn btn-danger btn-sm" title="点击删除问题" ng-click="removeQuestion($index)">
                    删除问题
                </button>
                <div class="checkbox">
                    <label> <input type="radio" ng-model="que.type" value="radio">单选</label>

                </div>
                <div class="checkbox">
                    <label> <input type="radio" ng-model="que.type" value="checkbox">多选</label>
                </div>
            </div>
        </div>
        <div class="panel-body">
            <div class="form-group" ng-repeat="opt in que.options track by $index">
                <div class="form-inline">
                    <div class="col-sm-1"></div>
                    <label class="control-label" ng-bind="'选项'+($index+1)"></label>
                    <input type="text" class="form-control" placeholder="在这里输入选项" ng-model="opt.title">
                    <button type="button" class="btn btn-danger btn-sm" title="点击删除选项"
                            ng-click="removeOption(que,$index)">
                        删除选项
                    </button>
                    备注
                    <div class="checkbox">
                        <label> <input type="radio" ng-model="opt.isInput" value="is">需要</label>

                    </div>
                    <div class="checkbox">
                        <label> <input type="radio" ng-model="opt.isInput" value="not">不需要</label>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<div class="modal-footer">
    <button class="btn btn-primary" type="button" ng-click="ok()">OK</button>
    <button class="btn btn-warning" type="button" ng-click="cancel()">Cancel</button>
</div>